package com.sh.data.engine.application.model.request.datadev;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author: zigui.zdf
 * @description:
 * @date: 2021/6/9 17:42
 */
@Data
@Schema
public class SaveFunctionNodeRequest {

    @Schema(description = "节点id，编辑时传入")
    private Long nodeId;

    @Schema(description = "父id")
    private Long pid;

    @Schema(description = "名称")
    @NotBlank(message = "名称不能为空")
    @Length(min = 1, max = 32, message = "名称长度为1-32个字符")
    @Pattern(regexp = "[a-zA-Z0-9_\\u4e00-\\u9fa5]+", message = "名称支持中文、字母、数字、下划线")
    private String nodeName;

    @Schema(description = "函数类型，1-udf 2-udaf 3-udtf", allowableValues = {"1", "2", "3"})
    //@NotNull(message = "函数类型不能为空")
    private Integer functionType;

    @Schema(description = "类名")
    @NotBlank(message = "类名不能为空")
    private String className;

    @Schema(description = "资源id")
    @NotNull(message = "资源不能为空")
    private Long resourceNodeId;

    @Schema(description = "用途")
    private String purpose;

    @Schema(description = "命令格式")
    @NotBlank(message = "命令格式不能为空")
    private String format;

    @Schema(description = "参数说明")
    private String paramDesc;

    @Schema(description = "函数名称")
    private String functionName;


    @Schema(description = "used desc")
    private String usedDesc;


}
